package com.jwinni.IO.StreamWriterAndReader;

import java.io.*;

/*
转换流
*/
public class DemoSWR {
    public static void main(String[] args) throws IOException {

        InputStreamReader isr =new InputStreamReader(new FileInputStream("static/a.txt"),"UTF-8");
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("static/g.txt"),"GBK");

        int len=0;
        while ((len=isr.read())!=-1){
            osw.write(len);
        }
        isr.close();
        osw.close();
    }

}
